package com.lijie.ljblog.common;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lijie.ljblog.mapper.GameMapper;
import com.lijie.ljblog.model.Game;
import com.lijie.ljblog.service.GameCalculateContext;
import com.lijie.ljblog.service.GameService;
import org.apache.commons.lang3.StringUtils;

/**
 * @Description
 * @Author lijie
 * @Date 2022/10/22 16:04
 **/
public abstract  class GameAbstractStrategy extends ServiceImpl<GameMapper, Game>  implements GameService {
    // 类注册方法
    public void register(String gameServiceType) {
        if(StringUtils.isNotEmpty(gameServiceType)){
            GameCalculateContext.registerGameService(gameServiceType, this);
        }else{
            GameCalculateContext.registerGameService(getClass().getSimpleName(), this);
        }

    }

}
